/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package trial.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
 * @author feifei
 */

@Entity
@XmlRootElement
@XmlType(name = "Sell", propOrder = {
    "id",
    "shop",
    "item",
    "storage",
    "orders"
})
@Table(name = "TRIAL_SELL",schema="trial")
public abstract class Sell implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    
    @ManyToOne
    private Shop shop;
    @ManyToOne
    private Item item;
    private Long storage;
    
    @OneToMany(mappedBy="sell")
    private List<SingleOrder> orders;
    
    public Sell()
    {
    }
    public Sell(Shop shop,Item item)
    {
        this.shop=shop;
        this.item=item;
    }

    public Sell(Shop shop, Item item, Long storage) {
        this.shop = shop;
        this.item = item;
        this.storage = storage;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getStorage() {
        return storage;
    }

    public void setStorage(Long storage) {
        this.storage = storage;
    }
    
    public Shop getShop() {
        return shop;
    }

    public List<SingleOrder> getOrders() {
        return orders;
    }

    public void setOrders(List<SingleOrder> orders) {
        this.orders = orders;
    }

    
    public void setShop(Shop shop) {
        this.shop = shop;
    }

    
    public Item getItem()
    {
        return this.item;
    }
    public void setItem(Item item)
    {
        this.item=item;
    }
    
    
}
